package ar.edu.unlam.lyc.comunes;

import java.util.Hashtable;

public class PalabrasReservadas {
	private static PalabrasReservadas instance = null;
	private Hashtable<String, String> lista = null;
	private Hashtable<String, String> lista2 = null;

	private PalabrasReservadas() {
		this.lista = new Hashtable<String, String>();
		this.lista2 = new Hashtable<String, String>();

		this.lista.put("RSV_VAR", "var");
		this.lista2.put("var", "RSV_VAR");

		this.lista.put("RSV_ENDVAR", "endvar");
		this.lista2.put("endvar", "RSV_ENDVAR");

		this.lista.put("RSV_REAL", "real");
		this.lista2.put("real", "RSV_REAL");

		this.lista.put("RSV_INT", "int");
		this.lista2.put("int", "RSV_INT");

		this.lista.put("RSV_STR", "string");
		this.lista2.put("string", "RSV_STR");

		this.lista.put("RSV_DO", "do");
		this.lista2.put("do", "RSV_DO");

		this.lista.put("RSV_FOR", "for");
		this.lista2.put("for", "RSV_FOR");

		this.lista.put("RSV_ROF", "rof");
		this.lista2.put("rof", "RSV_ROF");

		this.lista.put("RSV_IF", "if");
		this.lista2.put("if", "RSV_IF");

		this.lista.put("RSV_ELSE", "else");
		this.lista2.put("else", "RSV_ELSE");

		this.lista.put("RSV_FI", "fi");
		this.lista2.put("fi", "RSV_FI");

		this.lista.put("RSV_AND", "and");
		this.lista2.put("and", "RSV_AND");

		this.lista.put("RSV_OR", "or");
		this.lista2.put("or", "RSV_OR");

		this.lista.put("RSV_NOT", "not");
		this.lista2.put("not", "RSV_NOT");

		this.lista.put("RSV_FTOC", "ftoc");
		this.lista2.put("ftoc", "RSV_FTOC");

		this.lista.put("RSV_CTOF", "ctof");
		this.lista2.put("ctof", "RSV_CTOF");

		this.lista.put("RSV_KTOC", "ktoc");
		this.lista2.put("ktoc", "RSV_KTOC");

		this.lista.put("RSV_CTOK", "ctok");
		this.lista2.put("ctok", "RSV_CTOK");

		this.lista.put("RSV_WPRINT", "wprint");
		this.lista2.put("wprint", "RSV_WPRINT");

	}

	public static PalabrasReservadas getInstance() {
		if (instance == null) {
			instance = new PalabrasReservadas();
		}
		return instance;
	}

	public boolean contains(String str) {
		return this.lista.contains(str);
	}

	public String getMnemonic(String str) {
		return (String) lista2.get(str);
	}
}
